import type { FieldRule } from "vant"

//定义表单校验规则
export const rulesMobile:FieldRule[]= [{ required: true, message: '请填写手机号' },
  {pattern:/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,message:'请输入合法的手机号码'
  }
 ]

export const rulesPassword:FieldRule[]=[{ required: true, message: '请填写密码' },
  {pattern:/^\w{8,24}$/,message: '请输入8~24位之间的密码'}
 ]

 export const rulesCode:FieldRule[]=[{ required: true, message: '请填写验证码' },
  {pattern:/^\w{6}$/,message: '必须输入6位数之间的短信验证码'}
 ]

 //定义患者身份信息规则校验
 export const rulesName:FieldRule[]=[{ required: true, message: '请填写姓名' },
  {pattern:/^(?:[\u4e00-\u9fa5·]{2,16})$/,message: '姓名必须输入2~16位数之间的中文'}
 ]
 export const rulesIdCard:FieldRule[]=[{ required: true, message: '请填写身份证号' },
  {pattern:/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/,message: '身份证号不正确'}
 ]


